package com.singzi.testCase;

import org.junit.Test;

import java.util.Stack;

public class StackTest {
    @Test
    public void bianli(){
        Stack<Integer> s = new Stack<Integer>();
        for (int i = 0; i < 10; i++) {
            s.push(i);
        }
        for (Integer x : s) {
            System.out.println(x);//输出0-9，这个顺序是压入的顺序
        }
    }
    @Test
    public void copyTest(){
        String s = "efsad";
        StringBuilder s1 = new StringBuilder(s);
        System.out.println(s1.equals(s));
        s1.setCharAt(1, '3');
        s = "dsfsdf";
        System.out.println(s);
        System.out.println(s1);
        String s2 = new String(s1);
        String n = "2332";
        char []strs = n.toCharArray();
        strs[2] = (char) (strs[2]-'1' + '0');
        System.out.println(strs);
        char[] ss = new char[4];
        System.arraycopy(strs, 0, ss, 0, 4);

    }
}
